package com.project.bean;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;

import java.time.LocalDate;

/**
 * 学生实体类
 */
@TableName("s_student")
public class StudentBean {
    //学生编号
    @TableId(value = "pk_stId",type = IdType.AUTO )
    private int id;
    //学生姓名
    @TableField("s_name")
    private String name;
    // 性别
    @TableField("s_gender")
    private String gender;
    //联系电话
    @TableField("s_phone")
    private String phone;
    //学生头像地址
    @TableField("s_faceImg")
    private String faceImg;
    //学生入住时间
    @TableField("s_liveTime")
    private LocalDate date = LocalDate.now();
    //学生所在班级
    @TableField("fk_roomId")
    private Integer classId;
    @TableField("fk_classId")
    private Integer roomId;

    @TableField(exist = false)
    private ClassBean classBean;
    //房间对象
    @TableField(exist = false)
    private RoomBean roomBean;

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getFaceImg() {
        return faceImg;
    }

    public void setFaceImg(String faceImg) {
        this.faceImg = faceImg;
    }

    public LocalDate getDate() {
        return date;
    }

    public void setDate(LocalDate date) {
        this.date = date;
    }

    public ClassBean getClassBean() {
        return classBean;
    }

    public void setClassBean(ClassBean classBean) {
        this.classBean = classBean;
    }

    public RoomBean getRoomBean() {
        return roomBean;
    }

    public void setRoomBean(RoomBean roomBean) {
        this.roomBean = roomBean;
    }

    @Override
    public String toString() {
        return "StudentBean{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", gender='" + gender + '\'' +
                ", phone='" + phone + '\'' +
                ", faceImg='" + faceImg + '\'' +
                ", date=" + date +
                ", classBean=" + classBean +
                ", roomBean=" + roomBean +
                '}';
    }

    public StudentBean() {
    }

    public Integer getClassId() {
        return classId;
    }

    public void setClassId(Integer classId) {
        this.classId = classId;
    }

    public Integer getRoomId() {
        return roomId;
    }

    public void setRoomId(Integer roomId) {
        this.roomId = roomId;
    }

//    public StudentBean(String name, String gender, String phone, String faceImg, Integer chId, Integer roId) {
//        this.name = name;
//        this.gender = gender;
//        this.phone = phone;
//        this.faceImg = faceImg;
//        this.classBean = new ClassBean();
//        classBean.setId(chId);
//        this.roomBean = new RoomBean();
//        roomBean.setId(roId);
//    }

    public StudentBean(String name, String gender, String phone, String faceImg, Integer classId, Integer roomId) {
        this.name = name;
        this.gender = gender;
        this.phone = phone;
        this.faceImg = faceImg;
        this.classId = classId;
        this.roomId = roomId;
    }
}
